import App from './App'
import {
	Button,
	Icon,
	Sticky,
	FloatingBubble,
	Popup,
	DatePicker,
	NumberKeyboard,
	Field,
	CellGroup,
	Cell,
	Toast,
	List,
	Loading,
	Overlay,
	Empty,
	SwipeCell,
	Form,
	Picker,
	Dialog,
	Switch,
	Col,
	Row,
	PickerGroup,
	PullRefresh,
	Checkbox,
	CheckboxGroup,
	ImagePreview,
	Swipe,
	SwipeItem
} from 'vant';
import store from './store'

// 2. 引入组件样式
import 'vant/lib/index.css';
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
Vue.prototype.$store = store
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	app.use(Button);
	app.use(Icon);
	app.use(Sticky);
	app.use(FloatingBubble);
	app.use(Popup);
	app.use(DatePicker);
	app.use(NumberKeyboard);
	app.use(Field);
	app.use(CellGroup);
	app.use(Cell);
	app.use(Toast);
	app.use(List);
	app.use(Loading);
	app.use(Overlay);
	app.use(Empty);
	app.use(SwipeCell);
	app.use(Form);
	app.use(Picker);
	app.use(Dialog);
	app.use(Switch);
	app.use(Col);
	app.use(Row);
	app.use(PickerGroup);
	app.use(PullRefresh);
	app.use(Checkbox);
	app.use(CheckboxGroup);
	app.use(ImagePreview);
	app.use(Swipe);
	app.use(SwipeItem);

	return {
		store,
		app
	}
}
// #endif